$(function () {
   layui.use('form',function () {
       var form = layui.form();
       /**
        *index
        * */
       //搜索监听
       $('input[name="staffSearch"]').keydown(function () {
           if (event.keyCode == 13) {
               var content = $('.input-search').val();
               console.log(content);

               //异步请求查找相应谈话记录
               $.post('', content, function(response) {
                   if (response.code == 0) {
                       //重新加载页面
                       location.reload();
                   } else {
                       layer.msg(response.msg,{icon: 2});
                   }
               }, 'json');
               return false;
           }
       });

       //点击查看谈话记录详情
       $(document).on('click','.index-staff .table .record',function (e) {

           // e.preventDefault(); //阻止默认跳转
           var dataId = $(this).attr('data-id'); //获取当前点击查看的id
           console.log(dataId);

           //异步请求渲染数据跳转到详情页
           $.post('', dataId, function(response) {
               if (response.code == 0) {
                   //重新加载页面
                   location.reload();
                   location.href = 'staffInterviewDetail';
               } else {
                   layer.msg(response.msg,{icon: 2});
               }
           }, 'json');
       })
   })
});